package com.example.base.net

import com.example.base.entity.*
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query

interface ApiServer {
    @POST(Const.LOGIN_URL)
    suspend fun login(@Body body: RequestBody): UserEntityResult

    @POST(Const.REGISTER_URL)
    suspend fun register(@Body body: RequestBody): UserEntityResult

    @GET(Const.BANNER_URL)
    suspend fun banner(): BannerEntityResult

    @GET(Const.CATE_URL)
    suspend fun cate(): CateEntityResult
    @GET(Const.GOODS_URL)
    suspend fun goods(
        @Query("category_id") category_id: Int,
        @Query("currentPage") currentPage: Int,
        @Query("pageSize") pageSize: Int
    ): GoodsEntityResult

    @GET(Const.DETAIL_URL)
    suspend fun detail(@Query("goods_id") goods_id:Int):DetailEntityResult
    @POST(Const.ADDCAR_URL)
    suspend fun addCar(@Body body: RequestBody):CarEntity
    @GET(Const.SELECTCAR_URL)
    suspend fun selectCar():ShopEntityResult
    @POST(Const.DELETECAR_URL)
    suspend fun deleteCar(@Body body: RequestBody):CarEntity

    @GET(Const.GETCOMMENT_URL)
    suspend fun getComment(@Query("videoId")videoId:Int):CommentEntityResult
    @GET(Const.GETCHILDCOMMENT_URL)
    suspend fun getChildComment(@Query("rootId")rootId:Int):CommentEntityResult
    @Multipart
    @POST(Const.UPDATE_ICON_URL)
    suspend fun updateIcon(@Part part:MultipartBody.Part):UpdateIconEntityResult
}